package cn.java63.biz2;

import cn.java63.biz.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class TestAno {
    public static void main(String[] args) {
        ApplicationContext ac=new ClassPathXmlApplicationContext("spring-aopano.xml");
        UserServiceAno userService= (UserServiceAno) ac.getBean(UserServiceAno.class);
        User user=new User(1000L,"老吴","12233","13625412563","44444444");
        boolean r=userService.add(user);
        List<User> list=userService.search();
        for(User s:list){
            //long id=s.getId();
            //if(s.getName().equals("admin")){
            //    boolean b=userService.del(id);
            //}else {
                System.out.println(s);
            //}
        }
        System.out.println("方法返回了："+r);
       /* try{
            boolean r2=userService.del(1L);
        }catch (Exception e){
            e.printStackTrace();
        }*/
    }
}
